# -*- coding: utf-8 -*-
"""
# @created on : 9月 2021/9/27 10:02
# @author     : kevin
# @file       : json.py
# @software   : PyCharm
# @project    : auto_keyword_data


@license: (C) Copyright 2019-2025, Corporation Limited.
@desc:
"""
from jsonpath_rw import jsonpath, parse
from common.log import Logger
import json


class OperationJson:
    def __init__(self):
        self.log = Logger()

    def get_data_from_key(self, response, key):
        value = parse(key).find(json.loads(response))
        return [math.value for math in value][0]

